package com.fling.tutorial;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.g2d.BitmapFont;
import com.badlogic.gdx.graphics.g2d.NinePatch;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.fling.observer.Subject;

public class LastState extends TutorialState {

	public LastState(TutorialManager t, Subject subject) {
		super(t, subject);
	}

	@Override
	public void update(float delta) {
		timer+=delta;
		if(timer > 2.5f){
			tutorial.setCompleted(true);
		}
	}

	@Override
	public void registerInput(INPUT input) {
		switch (input) {
		default:
			break;
		}
	}

	@Override
	public void enter() {

	}

	@Override
	public void exit() {
	}

	@Override
	public void render(SpriteBatch sb, NinePatch patch, BitmapFont font) {
		if(!tutorial.isCompleted()){
			patch.draw(sb, Gdx.graphics.getWidth() * 0.35f, Gdx.graphics.getHeight() * 0.7f, Gdx.graphics.getWidth() * 0.55f,
					Gdx.graphics.getHeight() * 0.15f);
			font.drawWrapped(sb, "Nice!\nNow avoid the blocks!", Gdx.graphics.getWidth() * 0.37f, Gdx.graphics.getHeight() * 0.81f,
					Gdx.graphics.getHeight() * 0.32f);
		}

	}

}
